home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_100
/
196_01
/
fp128.asm
< prev
next >
Wrap
Assembly Source File
|
1985-11-13
|
45KB
|
2,368 lines
TPALOC EQU 0100H
page 76
CPM: EQU 1
MPM2: EQU 0
if not cpm
CCCORG: EQU WHATEVER
RAM: EQU WHATEVER2
BASE: EQU WHATEVER3
endif
if cpm
base: equ 0000h
fcb: equ base+5ch
tbuff: equ base+80h
bdos: equ base+5
tpa: equ base+100h
nfcbs: equ 9
errorv: equ 255
cccorg: equ tpa
ram: equ cccorg+52Bh
endif
cr: equ 0dh
lf: equ 0ah
newlin: equ lf
tab: equ 9
bs: equ 08h
cntrlc: equ 3
fexitv: equ cccorg+09h
error: equ cccorg+1dh
exit: equ error+3
if cpm
close: equ error+6
setfcb: equ error+9
fgfd: equ error+12
fgfcb: equ error+15
setfcu: equ error+18
setusr: equ error+21
rstusr: equ error+24
khack: equ error+33
clrex: equ error+36
endif
eqwel: equ cccorg+0e5h
smod: equ cccorg+10fh
usmod: equ cccorg+129h
smul: equ cccorg+13fh
usmul: equ cccorg+16bh
usdiv: equ cccorg+189h
sdiv: equ cccorg+1cbh
cmphd: equ cccorg+1ddh
cmh: equ cccorg+1fah
cmd: equ cccorg+202h
ma1toh: equ cccorg+20ah
ma2toh: equ cccorg+213h
ma3toh: equ ma2toh+6
ma4toh: equ ma2toh+12
ma5toh: equ ma2toh+18
ma6toh: equ ma2toh+24
ma7toh: equ ma2toh+30
arghak: equ ma2toh+36
org ram
ds 20
errnum: ds 1
pbase: ds 2
ysize: ds 2
xsize: ds 2
psize: ds 2
rseed: ds 8
args: ds 14
iohack: ds 6
allocp: ds 2
alocmx: ds 2
room: ds 30
uroom: ds 20
extrns: equ cccorg+15h
cccsiz: equ cccorg+17h
codend: equ cccorg+19h
freram: equ cccorg+1bh
arg1: equ args
arg2: equ args+2
arg3: equ args+4
arg4: equ args+6
arg5: equ args+8
arg6: equ args+10
arg7: equ args+12
tmp: equ room
tmp1: equ room+1
tmp2: equ room+2
tmp2a: equ room+4
ungetl: equ room+6
unused: equ room+7
curusr: equ room+8
usrnum: equ room+9
mode: equ room+10
freeze: equ room+11
pending: equ room+12
pendch: equ room+13
quitc: equ room+14
echo: equ 1
quit: equ 2
flow: equ 4
strip: equ 8
expand: equ 16
swap: equ 32
if cpm
conin: equ 1
conout: equ 2
lstout: equ 5
dconio: equ 6
pstrng: equ 9
getlin: equ 10
cstat: equ 11
select: equ 14
openc: equ 15
closec: equ 16
delc: equ 19
reads: equ 20
creatc: equ 22
renc: equ 23
sdma: equ 26
gsuser: equ 32
readr: equ 33
writr: equ 34
cfsizc: equ 35
srrecc: equ 36
endif
BIASEXP EQU 0400H
NBYTES EQU 16
ORG TPALOC+200H
DB 0,0,0,0,0
FP128$BEG EQU $-TPALOC
DB 0
DW FP128$END-$-2
FP128$STRT EQU $
FP128$EF$FP128 EQU FP128$STRT
FP128$STRTC EQU $
call arghak
push b
lda arg1
ora a
FP128$R000 EQU $+1-FP128$STRT
jz FP128$L$FPTEST
cpi 11
FP128$R001 EQU $+1-FP128$STRT
jz FP128$L$FPIN
cpi 255
FP128$R002 EQU $+1-FP128$STRT
jz FP128$L$FPTST2
lhld arg2
xchg
FP128$R003 EQU $+1-FP128$STRT
lxi h,FP128$L$AREG
FP128$R004 EQU $+1-FP128$STRT
call FP128$L$UNPACK
lda arg1
cpi 10
FP128$R005 EQU $+1-FP128$STRT
jz FP128$L$FPCONV
lhld arg3
xchg
FP128$R006 EQU $+1-FP128$STRT
lxi h,FP128$L$BREG
FP128$R007 EQU $+1-FP128$STRT
call FP128$L$UNPACK
FP128$R008 EQU $+1-FP128$STRT
lxi h,FP128$L$EXITP
push h
lda arg1
cpi 1
FP128$R009 EQU $+1-FP128$STRT
jz FP128$L$FPMUL0
cpi 2
FP128$R010 EQU $+1-FP128$STRT
jz FP128$L$FPDIV0
cpi 3
FP128$R011 EQU $+1-FP128$STRT
jz FP128$L$FPADD0
cpi 4
FP128$R012 EQU $+1-FP128$STRT
jz FP128$L$FPSUB0
pop h
pop b
lxi h,0
ret
FP128$L$EXITP EQU $-FP128$STRT
lhld arg4
xchg
FP128$R013 EQU $+1-FP128$STRT
call FP128$L$PACK
FP128$R014 EQU $+1-FP128$STRT
lxi h,FP128$L$OVF
xra a
ora m
inx h
ora m
inx h
ora m
inx h
ora m
mov l,a
mvi h,0
pop b
ret
FP128$L$FPDIV0 EQU $-FP128$STRT
lxi h,0
FP128$R015 EQU $+1-FP128$STRT
shld FP128$L$OVF
FP128$R016 EQU $+1-FP128$STRT
shld FP128$L$ZERO
FP128$R017 EQU $+1-FP128$STRT
lhld FP128$L$BEXP
mov a,h
ora l
FP128$R018 EQU $+1-FP128$STRT
jz FP128$L$OVRFW
FP128$R019 EQU $+1-FP128$STRT
lhld FP128$L$AEXP
mov a,h
ora l
FP128$R020 EQU $+1-FP128$STRT
jz FP128$L$SETZERO
FP128$L$FDIV1 EQU $-FP128$STRT
lxi h,0
FP128$R021 EQU $+1-FP128$STRT
shld FP128$L$LA
FP128$R022 EQU $+1-FP128$STRT
shld FP128$L$LA+2
FP128$R023 EQU $+1-FP128$STRT
shld FP128$L$LA+4
FP128$R024 EQU $+1-FP128$STRT
shld FP128$L$LA+6
FP128$R025 EQU $+1-FP128$STRT
lxi h,FP128$L$LA+NBYTES+NBYTES-1
mvi b,NBYTES+1
xra a
FP128$R026 EQU $+1-FP128$STRT
call FP128$L$SFTR0
FP128$R027 EQU $+1-FP128$STRT
lxi h,FP128$L$BREG+NBYTES-1
xra a
FP128$R028 EQU $+1-FP128$STRT
call FP128$L$SFTR
FP128$R029 EQU $+1-FP128$STRT
lhld FP128$L$BEXP
inx h
FP128$R030 EQU $+1-FP128$STRT
shld FP128$L$BEXP
mvi b,NBYTES*8
FP128$L$FDIV2 EQU $-FP128$STRT
push b
FP128$R031 EQU $+1-FP128$STRT
lxi d,FP128$L$AREG+NBYTES-1
FP128$R032 EQU $+1-FP128$STRT
lxi h,FP128$L$BREG+NBYTES-1
FP128$R033 EQU $+1-FP128$STRT
call FP128$L$ICMP
FP128$R034 EQU $+1-FP128$STRT
jc FP128$L$FDIV3
FP128$R035 EQU $+1-FP128$STRT
lxi d,FP128$L$AREG
FP128$R036 EQU $+1-FP128$STRT
lxi h,FP128$L$BREG
FP128$R037 EQU $+1-FP128$STRT
call FP128$L$ISUB
xra a
FP128$L$FDIV3 EQU $-FP128$STRT
cmc
FP128$R038 EQU $+1-FP128$STRT
lxi h,FP128$L$LA
FP128$R039 EQU $+1-FP128$STRT
call FP128$L$SFTL
FP128$R040 EQU $+1-FP128$STRT
call FP128$L$SFTL
pop b
db 010h,0dch
FP128$R041 EQU $+1-FP128$STRT
lxi h,FP128$L$LA
FP128$R042 EQU $+1-FP128$STRT
lxi d,FP128$L$AREG
lxi b,NBYTES
ldir
FP128$R043 EQU $+1-FP128$STRT
lhld FP128$L$AEXP
lxi d,BIASEXP+2
dad d
xchg
FP128$R044 EQU $+1-FP128$STRT
lhld FP128$L$BEXP
xchg
FP128$R045 EQU $+1-FP128$STRT
jmp FP128$L$EXPNRM
FP128$L$FPMUL0 EQU $-FP128$STRT
lxi h,0
FP128$R046 EQU $+1-FP128$STRT
shld FP128$L$OVF
FP128$R047 EQU $+1-FP128$STRT
shld FP128$L$ZERO
FP128$R048 EQU $+1-FP128$STRT
lhld FP128$L$BEXP
mov a,h
ora l
FP128$R049 EQU $+1-FP128$STRT
jz FP128$L$SETZERO
FP128$R050 EQU $+1-FP128$STRT
lhld FP128$L$AEXP
mov a,h
ora l
FP128$R051 EQU $+1-FP128$STRT
jz FP128$L$SETZERO
FP128$L$FMUL3 EQU $-FP128$STRT
FP128$R052 EQU $+1-FP128$STRT
lxi h,FP128$L$AREG
FP128$R053 EQU $+1-FP128$STRT
lxi d,FP128$L$LA
lxi b,nbytes
ldir
FP128$R054 EQU $+1-FP128$STRT
lxi h,FP128$L$BREG
FP128$R055 EQU $+1-FP128$STRT
call FP128$L$IMUL
FP128$R056 EQU $+1-FP128$STRT
lhld FP128$L$AEXP
xchg
FP128$R057 EQU $+1-FP128$STRT
lhld FP128$L$BEXP
dad d
lxi d,BIASEXP
FP128$L$EXPNRM EQU $-FP128$STRT
ora a
dsbc d
FP128$R058 EQU $+1-FP128$STRT
shld FP128$L$AEXP
FP128$R059 EQU $+1-FP128$STRT
jc FP128$L$UNDRFW
mov a,h
cpi BIASEXP/128
FP128$R060 EQU $+1-FP128$STRT
jnc FP128$L$OVRFW
FP128$R061 EQU $+1-FP128$STRT
lda FP128$L$ASIGN
FP128$R062 EQU $+1-FP128$STRT
lxi h,FP128$L$BSIGN
xra m
FP128$R063 EQU $+1-FP128$STRT
sta FP128$L$ASIGN
FP128$R064 EQU $+1-FP128$STRT
jmp FP128$L$FPNORM
FP128$L$FPSUB0 EQU $-FP128$STRT
FP128$R065 EQU $+1-FP128$STRT
lda FP128$L$BSIGN
xri 080h
FP128$R066 EQU $+1-FP128$STRT
sta FP128$L$BSIGN
FP128$L$FPADD0 EQU $-FP128$STRT
lxi h,0
FP128$R067 EQU $+1-FP128$STRT
shld FP128$L$OVF
FP128$R068 EQU $+1-FP128$STRT
shld FP128$L$ZERO
FP128$R069 EQU $+1-FP128$STRT
lhld FP128$L$AEXP
mov a,h
ora l
xchg
FP128$R070 EQU $+1-FP128$STRT
jnz FP128$L$FADD1
FP128$R071 EQU $+1-FP128$STRT
lxi h,FP128$L$BREG
FP128$R072 EQU $+1-FP128$STRT
lxi d,FP128$L$AREG
lxi b,NBYTES+3
ldir
FP128$R073 EQU $+1-FP128$STRT
jmp FP128$L$FPNORM
FP128$L$FADD1 EQU $-FP128$STRT
FP128$R074 EQU $+1-FP128$STRT
lhld FP128$L$BEXP
mov a,h
ora l
FP128$R075 EQU $+1-FP128$STRT
jz FP128$L$FPNORM
xchg
dsbc d
FP128$R076 EQU $+1-FP128$STRT
jz FP128$L$FADD4
FP128$R077 EQU $+1-FP128$STRT
jnc FP128$L$FADD2
FP128$R078 EQU $+1-FP128$STRT
lda FP128$L$ASIGN
mov c,a
FP128$R079 EQU $+1-FP128$STRT
lda FP128$L$BSIGN
FP128$R080 EQU $+1-FP128$STRT
sta FP128$L$ASIGN
mov a,c
FP128$R081 EQU $+1-FP128$STRT
sta FP128$L$BSIGN
FP128$R082 EQU $+1-FP128$STRT
lxi h,FP128$L$AREG
FP128$R083 EQU $+1-FP128$STRT
lxi d,FP128$L$BREG
mvi b,nbytes+2
FP128$R084 EQU $+1-FP128$STRT
call FP128$L$SWAP0
FP128$R085 EQU $+1-FP128$STRT
s